package org.wzh.spring.mock.test;

import org.mockito.Mockito;

public class Dog {

	private String name;
	private int age;

	public void bark() {
		System.out.println("wang wang ..");
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the age
	 */
	public int getAge() {
		return age;
	}

	/**
	 * @param age
	 *            the age to set
	 */
	public void setAge(int age) {
		this.age = age;
	}

	public static void main(String[] args) {
		Dog dog = Mockito.mock(Dog.class);
		Mockito.when(dog.getAge()).thenReturn(7);
		Mockito.when(dog.getName()).thenReturn("Bob");
		System.out.println(dog.getAge());
	}

}
